Conditions | 2 |
Total Lines | 25 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { ClassHash } from "../../src/main.types" |
||
2 | |||
3 | // type Excluder< |
||
4 | // S extends Record<string, ClassHash>, |
||
5 | // E extends {[K in keyof S]?: ClassHash} |
||
6 | // > = { [P in Exclude<keyof S, keyof E>]: S[P]; } |
||
7 | |||
8 | // interface Exclusion< |
||
9 | // S extends Record<string, ClassHash> |
||
10 | // > { |
||
11 | // (source: S, ex: {[K in keyof S]?: ClassHash}): Excluder<S, typeof ex> |
||
12 | // } |
||
13 | |||
14 | function exclusion< |
||
15 | E extends Record<string, ClassHash>, |
||
16 | S extends Record<keyof E, ClassHash> |
||
17 | >( |
||
18 | source: S, ex: E |
||
19 | ): { [P in Exclude<keyof S, keyof E>]: S[P]; } |
||
20 | { |
||
21 | const $return = {...source} |
||
22 | for (const k in ex) { |
||
23 | delete $return[k] |
||
24 | } |
||
25 | |||
26 | return $return |
||
27 | } |
||
48 | export {step2, answ0} |